{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\fs24 \cf0 #include <stdlib.h>\
#include <ncurses.h>\
#include <string.h>\
\
\
int main()\
\{	\
\
	\
\
	int 	c, Q, \
		row, \
		col,\
		strow, \
		stcol;\
\
\
	initscr();			/* Start curses mode 		  */\
	cbreak();			/* Line buffering disabled	  */\
	keypad(stdscr, TRUE);		/* Allows F1, arrows keys, etc.   */\
\
\
	wborder(stdscr, '|', '|', '-', '-', '+', '+', '+', '+');\
	getmaxyx(stdscr,row,col);\
	strow = row/2;\
	stcol = col/2;\
\
	mvprintw(strow, stcol, "Hello World!!");\
\
	while((c = getch()) != q)\
	\{	switch(c)\
		\{	case KEY_LEFT:\
				mvprintw(strow, stcol, "             ");\
				mvprintw(strow, stcol-=3, "Hello World!!");\
				refresh();\
				break;\
			case KEY_RIGHT:\
 	                        mvprintw(strow, stcol, "             ");\
				mvprintw(strow, stcol+=3, "Hello World!!");\
				refresh();\
				break;\
			case KEY_UP:\
                                mvprintw(strow, stcol, "             ");\
				mvprintw(strow-=1, stcol, "Hello World!!");\
				refresh();\
				break;\
			case KEY_DOWN:\
                                mvprintw(strow, stcol, "             ");\
				mvprintw(strow+=1, stcol, "Hello World!!");\
				refresh();\
				break;	\
		\}\
		\
\
	\}\
		\
	refresh();\
	endwin();			/* End curses mode		  */\
\
	return 0;\
\}\
\
}